import {request} from "../../utils/request.js"

// 开桌
export const openTable = (params) => 
	request({
		url: `/table/open/${params.tableId}/${params.seatNumber}`,
		method: 'GET',
		params
	})

// 获取桌台状态
export const getTableState = (params) => 
	request({
		url: `/table/tableStatus/${params.shopId}/${params.storeId}/${params.tableId}`,
		method: 'GET',
		params,
	})
	
// 获取购物车菜品
export const getTableOrderDishList = (params) =>
	request({
		url: `/order/shopCart//${params.tableId}`,
		method: 'GET',
		params
	})
// 获取菜品规格
export const getMoreNorm = (params) => 
	request({
		url: `/dish/flavor/${params.dishId}`,
		method: 'GET',
		params,
	})	
	
// 获取菜品分类列表	
export const getList = (params) => 
	request({
		url: `/dish/category`,
		method: 'GET',
		params,
	})
	
// 获取菜品详情	
export const getDishDetail = (params) => 
	request({
		url: `/dish/setmealDishList/${params.setmealId}`,
		method: 'GET',
		params,
	})
	
// 根据分类获取菜品列表
export const getDishList = (params) => 
	request({
		url: `/dish/dishPageList/${params.categoryId}/${params.type}/${params.page}/${params.pageSize}`,
		method: 'GET',
		params
	})

// 加菜
export const addDish = (params) => 
	request({
		url: `/order/addDish`,
		method: 'POST',
		params
	})
	
// 减菜
export const delDish = (params) => 
	request({
		url: `/order/decreaseDish/${params.tableId}/${params.dishId}`,
		method: 'GET',
		params
	})	
	
// 清空购物车
export const clearOrder = (params) => 
	request({
		url: `/order/cleanShopCart/${params.tableId}`,
		method: 'GET',
		params
	})
	
// 提交订单 
export const payOrder = (params) => 
	request({
		url: `/order/pay/${params.tableId}/${params.jsCode}`,
		method: 'GET',
		params
	})
	
// 取消支付 
export const cancelPay = (params) => 
	request({
		url: `/order/cancelPay/${params.tableId}`,
		method: 'GET',
		params
	})	